package com.gxa.shop.service.carousel.impl;

import com.gxa.shop.bean.dto.Page;
import com.gxa.shop.bean.pojo.Carousel;
import com.gxa.shop.dao.carousel.CarouselDao;
import com.gxa.shop.dao.carousel.impl.CarouselDaoImpl;
import com.gxa.shop.service.carousel.CarouselService;

import java.util.List;

/**
 * com.gxa.shop.service.carousel.impl
 * User: 刁彦侨
 * Date: 2024/12/19 10:18
 * motto:   逆水行舟不进则退
 * Description:
 * Version: V1.0
 */
public class CarouselServiceImpl implements CarouselService {
    private CarouselDao carouselDao = new CarouselDaoImpl();

    @Override
    public List<Carousel> getCarousels() {
        return carouselDao.getCarousel();
    }

    @Override
    public List<Carousel> findByPage(Page page) {
        return carouselDao.findByPage(page);
    }

    @Override
    public boolean addCarousel(Carousel carousel) {
        return carouselDao.addCarousel(carousel)>0;
    }

    @Override
    public boolean updateCarousel(Carousel carousel) {
        return carouselDao.update(carousel)>0;
    }

    @Override
    public boolean deleteCarousel(Integer carouselId) {
        return carouselDao.deleteById(carouselId)>0;
    }

    @Override
    public Long findByTotal() {
        return carouselDao.findByTotal();
    }
}
